import server from './server.js';
const BASE_URL = '//blueberry.meizu.com'

const API = {
  'search': '/api/project/search', // 搜索资源文挡
  'release': '/api/project/release' // 发布
}

/**
 * 获取用户认证状态
 * @param {Object} config
 */
export function search(keyword: string, config: any = {}) {
  return server.get(BASE_URL + API.search, {
    keyword
  }, {
    isLogin: true,
    ...config
  });
}

/**
 * 发布资源
 * @param {Object} config
*/
type configListItme = {
  key: string
  value: string
  desc: string | null
  url: string | null
}
export type releaseData = {
  configList: configListItme[]
  desc: string | undefined
  projectId: string,
}
export function release(data:releaseData, config: any = {}) {
  return server.post(BASE_URL + API.release, {
    ...data
  }, {
    isLogin: true,
    ...config
  });
}


